var t = getApp();

Page({
    data: {
        Amount: "",
        condition: !0,
        pic: "../../images/20.png",
        canIu: !1
    },
    onLoad: function(n) {
        this.setData({
            demand: n.demand
        }), wx.getStorageSync("CsTelphone") || t.GetUrl(), 1 == wx.canIUse("button.open-type.contact") && this.setData({
            canIu: !0
        });
    },
    callus: function() {
        wx.makePhoneCall({
            phoneNumber: wx.getStorageSync("CsTelphone")
        });
    },
    back: function() {
        wx.switchTab({
            url: "../Draft/Draft"
        });
    },
    formSubmit: function(t) {
        var n = t.detail.value.price, e = t.detail.value.text;
        !n || n.length <= 0 ? wx.showModal({
            title: "提示",
            content: "你没有选择价格，请回到界面选择价格！",
            showCancel: !1,
            success: function(t) {
                t.confirm ? console.log("用户点击确定") : t.cancel && console.log("用户点击取消");
            }
        }) : wx.redirectTo({
            url: "../Wdraftpay/Wdraftpay?Amount=" + n + "&demand=" + e
        });
    },
    radioChange: function(t) {
        console.log("radioChange信息：", t), this.setData({
            Amount: t.detail.value
        });
    },
    onShareAppMessage: function(t) {
        return "button" === t.from && console.log(t.target), {
            title: "合同起草助手",
            path: "",
            success: function(t) {},
            fail: function(t) {}
        };
    },
    Operate: function() {
        var t = this;
        wx.showActionSheet({
            itemList: [ "拨打电话", "委托须知" ],
            success: function(n) {
                console.log(n.tapIndex), 0 == n.tapIndex && t.callus(), 1 == n.tapIndex && t.wxAddNote();
            },
            fail: function(t) {
                console.log(t.errMsg);
            }
        });
    },
    wxAddNote: function() {
        this.setData({
            condition: !1,
            CsWxnum: wx.getStorageSync("CsWxnum")
        });
    },
    closeCluepage: function() {
        this.setData({
            condition: !0
        });
    }
});